import request from '@/utils/request'

/**
 * 查询权限
 */
 export const permission = (params, page, size) => {
  return request({
    url: `/sys/permission/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}

/**
 * 获取所有权限
 */
 export const permissionList = () => {
  return request({
    url: '/sys/permission/tree'
  })
}

// 获取用户的权限
export const userPermission = (roleId) => {
  return request({
    url: `/sys/role/permission/${roleId}`
  })
}

// 分配用户权限
export const distributionPermission = (params) => {
  return request({
    url: '/sys/role/distribute-permission',
    method: 'POST',
    data: params
  })
}
